//
//  TaskCollectionViewCell.m
//  GuoBuGaForIphone
//
//  Created by zhangwo on 16/10/31.
//  Copyright © 2016年 GuoBuGa. All rights reserved.
//

#import "TaskCollectionViewCell.h"

@implementation TaskCollectionViewCell

@synthesize imageView = _imageView;
@synthesize titleLabel = _titleLabel;
@synthesize data = _data;
@synthesize view = _view;

- (instancetype)initWithFrame:(CGRect)frame{
    if (self = [super initWithFrame:frame]) {
        _view = [[UIView alloc] initWithFrame:CGRectMake(0, 10, 26, 90)];
        [self addSubview:_view];
        
        _imageView = [[UIImageView alloc] initWithFrame:CGRectMake((frame.size.width-30)/2, 10, 30, 30)];
        [_view addSubview:_imageView];
        
        _titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 50, frame.size.width, 20)];
        _titleLabel.font = [UIFont systemFontOfSize:14.0];
        _titleLabel.textAlignment = NSTextAlignmentCenter;
        [_view addSubview:_titleLabel];
    }
    return self;
}

- (void)setData:(NSDictionary *)data{
    _data = data;
    _imageView.image = [UIImage imageNamed:[data objectForKey:@"image"]];
    _titleLabel.text = [data objectForKey:@"title"];
}

@end
